const validateProbabilities = (probabilities) => {
  const parsedProbabilities = probabilities.map(Number);
  if (!parsedProbabilities.every(p => p >= 0 && p <= 1)) {
    return false;
  }
  const sum = parsedProbabilities.reduce((acc, p) => acc + p, 0);
  return Math.abs(sum - 1) < 1e-6;
};

module.exports = validateProbabilities;